<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var arr = [];
        for (var i = 1; i <= 10; i++) {
            // arr[arr.length] = i;
            arr.push(i);
        }
        console.log(arr);
        
        // 放入10000个偶数
        var arr = [];
        for (var i = 1; i <= 10000; i++) {
            // arr[arr.length] = i;
            arr.push(2 * i);
        }
        console.log(arr);

        // 放入10000个偶数
        var arr = [];
        var current = 2;
        while (arr.length < 10000) {
            arr.push(current);
            current += 2;
        }
        console.log(arr);
    </script>
</body>
</html>